Skip to content

feat: bridge useq plate_row/plate_col and use useq grid position names#124

Closed
ieivanov wants to merge 3 commits into
pymmcore-plus:mainfrom
ieivanov:add-plate-row-col
Closed

feat: bridge useq plate_row/plate_col and use useq grid position names#124
ieivanov wants to merge 3 commits into
pymmcore-plus:mainfrom
ieivanov:add-plate-row-col

Conversation

@ieivanov
Copy link
Copy Markdown
Contributor

@ieivanov ieivanov commented Mar 24, 2026

Summary

Updates ome_writers to consume the new plate_row/plate_col fields from useq positions and delegate all position naming to useq-schema.

Bridge useq plate_row/plate_col to ome-writers positions

  • Propagate useq.Position.plate_row/plate_colome_writers.Position.plate_row/plate_column in _build_stage_positions_plan and _pos_with_grid_point.
  • Handle both int (0-based index → letter/number) and str (pass-through) via new _plate_row_to_str / _plate_col_to_str helpers.
  • Build a Plate object from position plate_row/plate_col annotations in _plate_from_useq when no WellPlatePlan is present.

Use useq grid position names (stop overriding)

  • _build_well_plate_positions: uses well_pos.name (from useq's name_pattern) instead of inventing fov{idx}.
  • _pos_with_grid_point: uses gp.name instead of overriding to fov{gp_idx} for plate positions.
  • All position naming now originates from useq-schema's name_pattern field on grid plans.

Full pipeline

YAML (positions with plate_row/plate_col + grid_plan)
  → useq.MDASequence (names auto-generated from plate coords)
  → useq_to_acquisition_settings()
  → AcquisitionSettings (with Plate + plate-annotated positions)
  → OMEStream → HCS zarr

zarr structure: plate_row/plate_column/grid_name
  e.g., A/1/0000, A/1/0001, B/2/0000, B/2/0001

Example

# useq YAML config
stage_positions:
- x: 1000
  y: 1000
  plate_row: 0
  plate_col: 0
- x: 2000
  y: 2000
  plate_row: 1
  plate_col: 1

grid_plan:
  rows: 2
  columns: 2
  fov_width: 180
  fov_height: 180

Produces zarr paths: A/1/0000, A/1/0001, ..., B/2/0000, B/2/0001, ...

Depends on: pymmcore-plus/useq-schema#268

Test plan

  • All 128 existing tests pass (1 pre-existing failure excluded)
  • Updated well_plate_with_points test expectations (fov0 → 0000)
  • Updated test_well_plate_fov_folder_names zarr path expectations
  • End-to-end: verify HCS zarr output with plate-annotated positions + grid_plan

🤖 Generated with Claude Code

Propagate useq.Position.plate_row/plate_col to ome_writers
Position.plate_row/plate_column in _build_stage_positions_plan. Build
a Plate from position annotations when no WellPlatePlan is present.
Use fov-style naming for grid points within plate wells to avoid
duplicate output keys in acquire-zarr.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 80.64516% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.48%. Comparing base (71dc491) to head (f8d97e0).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/ome_writers/_useq.py 80.64% 6 Missing ⚠️

❌ Your patch status has failed because the patch coverage (80.64%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
- Coverage   97.69%   97.48%   -0.22%     
==========================================
  Files          21       21              
  Lines        2516     2543      +27     
==========================================
+ Hits         2458     2479      +21     
- Misses         58       64       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Stop renaming positions to fov{idx}. Instead use the grid point's
name from useq (set by name_pattern on the grid plan). This moves
all position naming responsibility to useq-schema.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ieivanov ieivanov changed the title feat: bridge useq plate_row/plate_col to ome_writers positions feat: bridge useq plate_row/plate_col and use useq grid position names Mar 25, 2026
Add _plate_row_to_str and _plate_col_to_str helpers to handle both
int (0-based index) and str (direct name) plate coordinates from
useq positions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant